package com.itmei.sms.enums;

/**
 * @Author itmei
 * @Date 2023/2/2 16:29
 * @description: 短信场景枚举
 * @Title: SmsSceneEnum
 * @Package com.itmei.sms.enums
 */
public enum SmsSceneEnum {
    APPOINTMENT_SUCCESS(1,"appointment_success", "预约成功"),
    WILL_ARRIVE_STORE(2, "will_arrive_store","即将店前"),
    SEND_IT_THE_NIGHT_BEFORE(3,"send_it_the_night_before" ,"提前一天晚上发送"),
    VERIFICATION_CODE_SMS(4,"verification_code_sms","验证码短信");

    private Integer code;
    private String sceneCode;
    private String scencName;

    SmsSceneEnum(Integer code,String sceneCode, String scencName) {
        this.code = code;
        this.sceneCode = sceneCode;
        this.scencName = scencName;
    }

    public Integer getCode() {
        return code;
    }

    public String getScencName() {
        return scencName;
    }

    public String getSceneCode() {
        return sceneCode;
    }

    public static SmsSceneEnum getSmsSceneEnum(Integer code){
        for (SmsSceneEnum value : SmsSceneEnum.values()) {
            if (value.getCode().equals(code)){
                return value;
            }
        }
        throw new IllegalArgumentException("短信场景枚举通过code返回异常");
    }
}
